package com.bto.solar.work.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.util.List;

/**
 * @author Administrator
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class CreateUserReq {

    @ApiModelProperty("用户id")
    private Long userId;

    @NotBlank(message = "[用户名称]不能为空")
    @ApiModelProperty("用户名")
    private String name;

    @NotBlank(message = "[用户账号]不能为空]")
    @ApiModelProperty("用户账号")
    public String account;

    @Pattern(regexp = "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", message = "邮箱格式异常")
    @ApiModelProperty("邮箱")
    private String email;

    @NotBlank(message = "[用户手机号]不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号格式异常")
    @ApiModelProperty("电话")
    private String phone;

    @ApiModelProperty("头像")
    private String avatar;

    @NotNull(message = "[公司ID]不能为空")
    @ApiModelProperty("公司ID")
    private Long companyId;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("用户部门")
    private List<Long> departmentIds;

    @ApiModelProperty("权限列表")
    private List<String> permissionList;

    @Min(value = 0, message = "性别是男，女，未知")
    @Max(value = 2, message = "性别是男，女，未知")
    @ApiModelProperty("性别")
    private Byte gender;

    @ApiModelProperty("角色列表")
    private List<String> rolesIds;

}
